package com.cwz.taculture.service.sign.impl;

import com.cwz.taculture.mapper.sign.SignFindByRnumberMapper;
import com.cwz.taculture.pojo.UserPojo;
import com.cwz.taculture.service.sign.SignFindByRnumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 登录的service
 */

@Service
public class SignFindByRnumberServiceImpl implements SignFindByRnumberService {

    @Autowired
    private SignFindByRnumberMapper signFindByRnumberMapper;

    /**
     * 登录功能 根据用户名/手机号，密码进行登录
     *
     * @param userName   用户名
     * @param userNumber 手机号
     * @param userPwd    密码
     * @return Register对象
     */
    @Override
    public UserPojo login(String userName, String userNumber, String userPwd) {
        return signFindByRnumberMapper.login(userName,userNumber,userPwd);
    }

    /**
     * 查询用户名是否存在
     *
     * @param userName 用户名
     * @return
     */
    @Override
    public String findRegisterRname(String userName) {
        return signFindByRnumberMapper.findRegisterRname(userName);
    }

    /**
     * 查询Register用户电话是否存在
     *
     * @param userNumber 用户电话
     * @return
     */
    @Override
    public String findRegisterByRnumber(String userNumber) {
        return signFindByRnumberMapper.findRegisterByRnumber(userNumber);
    }
}
